@include('admin\header')
    <!-- iCheck-->
    <link rel="stylesheet" href="{{asset('admin/plugins/icheck/css/_all.css')}}">
<link rel="stylesheet" href="{{asset('admin/plugins/bootstrap-wysihtml5/css/bootstrap-wysihtml5.css')}}">

    <!-- Fonts -->
    <!-- <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,900,300italic,400italic,600italic,700italic,900italic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'> -->
    <!-- Feature detection -->
    <script src="{{asset('admin/js/modernizr-2.6.2.min.js')}}"></script>
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="admin/js/html5shiv.js"></script>
    <script src="admin/js/respond.min.js"></script>

    <![endif]-->
</head>

<body>
    <section id="container">
        @include('admin\nav')
        @include('admin\laside')
        <!--main content start-->
        <section class="main-content-wrapper">
            <section id="main-content">
                <div class="row">
                    <div class="col-md-12">
                        <!--breadcrumbs start -->
                        <ul class="breadcrumb">
                            <li><a href="#">Dashboard</a>
                            </li>
                            <li>Forms</li>
                            <li class="active">Form Validation</li>
                        </ul>
                        <!--breadcrumbs end -->
                        {{--<h1 class="h1">添加商品</h1>--}}
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title">添加栏目详细信息</h3>
                                <div class="actions pull-right">
                                    <i class="fa fa-chevron-down"></i>
                                    <i class="fa fa-times"></i>
                                </div>
                            </div>
                            <div class="panel-body">

                                <form action="" method="post"  class="form-horizontal form-border" id="form" enctype="multipart/form-data">
                                    {{csrf_field()}}

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">栏目名称</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="cat_name" id="input1" required="" placeholder="输入栏目名称">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">选择栏目</label>
                                        <div class="col-sm-6">
                                            <select name="parent_id" id="" placeholder="选择所属栏目">

                                                @forelse($cat as $v)
                                                    <option value="{{$v->parent_id}}"> {{$v->cat_name}} </option>



                                                    @if($v['parent_id']==0)
                                                <option value="{{$v->parent_id}}"> 000{{$v->cat_name}} </option>
                                                        @foreach($cat as $vv)
                                                            @if($v['cat_id']==$v['parent_id'])
                                                <option value="{{$vv->parent_id}}">&nbsp;&nbsp;{{$vv->cat_name}} </option>
                                                            @endif
                                                        @endforeach

                                                    @endif

                                                    @empty
                                                    <option value="0"> 一级栏目777777</option>
                                                @endforelse

                                            </select>

                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">栏目简介</label>
                                        <div class="col-sm-6">
                                            <textarea name="cat_intro" id="" cols="30" rows="10" placeholder="栏目简介内容"></textarea>

                                        </div>
                                    </div>


                                    <div class="form-group">
                                        <div class="col-sm-offset-8">
                                            <button type="submit" class="btn btn-primary">增加栏目</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </section>
        <!--main content end-->
    @include('admin\raside')
    </section>
    <script src="{{asset('admin/js/jquery-1.10.2.min.js')}}"></script>
    <script src="{{asset('admin/plugins/bootstrap/js/bootstrap.min.js')}}"></script>
    <script src="{{asset('admin/plugins/waypoints/waypoints.min.js')}}"></script>
\   <script src="{{asset('admin/js/application.js')}}"></script>
    <!--Page Level JS-->
    <script src="{{asset('admin/plugins/icheck/js/icheck.min.js')}}"></script>
    <script src="{{asset('admin/plugins/validation/js/jquery.validate.min.js')}}"></script>
    <script src="{{asset('admin/plugins/validation/js/jquery.validate.min.js')}}"></script>

    <script src="{{asset('admin/plugins/bootstrap-wysihtml5/js/wysihtml5-0.3.0.js')}}"></script>

    <script src="{{asset('admin/plugins/bootstrap-wysihtml5/js/bootstrap3-wysihtml5.js')}}"></script>
    <script src="{{asset('admin/plugins/ckeditor/ckeditor.js')}}"></script>

    <script>
        $(document).ready(function() {
            $('.textarea').wysihtml5();

            CKEDITOR.replace('editor1');
        });
    </script>

    <script>
        $(document).ready(function() {
            $('#form').validate({
                rules: {
                    input1: {
                        required: true
                    },
                    input2: {
                        minlength: 12,
                        required: true
                    },
                    input3: {
                        maxlength: 13,
                        required: true
                    },
                    input4: {
                        required: true,
                        numeric:true,
                        /*minlength: 4,
                        maxlength: 8*/
                    },
                    input5: {
                        required: true,
                        numeric:true,
                        /*min: 5*/
                    },
                    input6: {
                        required: true,
                        range: [1, 10]
                    },
                    input7: {
                        minlength: 5
                    },
                    input8: {
                        required: true,
                        minlength: 5,
                        equalTo: "#input7"
                    },
                    input9: {
                        required: true,
                        email: true
                    },
                    input10: {
                        required: true,
                        url: true
                    },
                    input11: {
                        required: true,
                        digits: true
                    },
                    input12: {
                        required: true,
                        phoneUS: true
                    },
                    input13: {
                        required: true,
                        minlength: 5
                    }
                },
                highlight: function(element) {
                    $(element).closest('.form-group').removeClass('success').addClass('error');
                },
                success: function(element) {
                    element.text('OK!').addClass('valid')
                        .closest('.form-group').removeClass('error').addClass('success');
                }
            });
        });
    </script>










</body>

</html>
